/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package state;

import cbaApplication.Files;
import cbaServer.BankServerCBAInterface;
import java.util.Vector;
import operacoes2.Levantamento;

/**
 *
 * @author Rente
 */
public class StateOff implements State {

    BankServerCBAInterface bankServerInterface;
    Files handler = Files.getInstance();

    public int fazLevantamento(String idConta, double quantia) {
        System.out.println("STAE OFF levantamento");
        if (quantia <= 100) {
            Vector<Levantamento> vect = handler.getBackup();
            vect.add(new Levantamento(idConta, quantia));
            handler.saveBackup(vect);
            return 1;
        } else {
            return -56;
        }
    }

    public BankServerCBAInterface getBankServerInterface() {
        return this.bankServerInterface;
    }

    public void setBankServerInterface(BankServerCBAInterface bankServerInterface) {
        this.bankServerInterface = bankServerInterface;
    }
}
